package com.jtny.nytb.equipment.vo.excel;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.jtny.nytb.valid.annotation.ValueValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Future;
import javax.validation.constraints.Past;
import javax.validation.constraints.PastOrPresent;
import java.io.Serializable;
import java.util.Date;

/**
 * @author 智慧能源中心 - 伍天宇
 * @package com.jtny.nytb.energymonitor.equipment.vo.device
 * @fileName EquipmentExcelVO.java
 * @createTime 2023年10月12日 17:37
 * @Copyright© 2023 jtny
 * 江投能源技术研究院 版权所有
 */
@Data
@ExcelIgnoreUnannotated
@ApiModel("计量器具ExcelVO对象")
public class ExcelInstrumentVO implements Serializable {
    // 基础信息
    @ExcelProperty(value = "计量器具名称")
    @ColumnWidth(30)
    @ApiModelProperty("计量器具名称")
    private String instrumentName;

    @ExcelProperty(value = "计量具类型")
    @ColumnWidth(30)
    @ApiModelProperty(value = "计量具类型")
    private String instrumentType;

    @ExcelProperty(value = "计量具级别")
    @ColumnWidth(10)
    @NumberFormat
    @ApiModelProperty(value = "计量器具级别")
    private Integer instrumentLevel;

    @ExcelProperty(value = "计量相关参数")
    @ColumnWidth(30)
    @ApiModelProperty(value = "计量相关参数")
    private String instrumentParameter;

    @ExcelProperty(value = "计量器具编号")
    @ColumnWidth(30)
    @ApiModelProperty(value = "计量器具编号")
    private String instrumentNo;

    @ExcelProperty(value = "生产厂家")
    @ColumnWidth(30)
    @ApiModelProperty(value = "生产厂家")
    private String instrumentVendor;

    @ExcelProperty(value = "型号规格")
    @ColumnWidth(30)
    @ApiModelProperty(value = "型号规格")
    private String instrumentModel;

    @ExcelProperty(value = "准确度等级")
    @ColumnWidth(30)
    @ApiModelProperty(value = "准确度等级")
    private String instrumentPrecision;

    @ExcelProperty(value = "测量范围")
    @ColumnWidth(30)
    @ApiModelProperty(value = "测量范围")
    private String instrumentRange;

    // 校准信息
    @ExcelProperty(value = "检验机构")
    @ColumnWidth(30)
    @ApiModelProperty(value = "检验机构")
    private String calibrationInstitution;

    @ExcelProperty(value = "检验状态：合格/不合格")
    @ColumnWidth(30)
    @ApiModelProperty(value = "检验状态：合格/不合格")
    @ValueValid(strValues = {"合格", "不合格"}, message = "检验状态非法")
    private String calibrationStatus;

    @ExcelProperty(value = "检验周期： X/月， X/年")
    @ColumnWidth(30)
    @ApiModelProperty(value = "检验周期： X/月， X/年")
    private String calibrationCycle;

    @ExcelProperty(value = "上次检验时间")
    @ColumnWidth(30)
    @DateTimeFormat("yyyy-MM-dd")
    @ApiModelProperty(value = "上次检验时间")
    @PastOrPresent(message = "上次检验时间非法")
    private Date calibrationLastTime;

    @ExcelProperty(value = "下次检验时间")
    @ColumnWidth(30)
    @DateTimeFormat("yyyy-MM-dd")
    @ApiModelProperty(value = "下次检验时间")
    @Future(message = "下次检验时间非法")
    private Date calibrationNextTime;

    @ExcelProperty(value = "检验原因")
    @ColumnWidth(30)
    @ApiModelProperty(value = "检验原因")
    private String calibrationReason;

    // 安装信息
    @ExcelProperty(value = "安装时间")
    @ColumnWidth(30)
    @DateTimeFormat("yyyy-MM-dd")
    @ApiModelProperty(value = "安装时间")
    @Past(message = "安装时间非法")
    private Date installTime;

    @ExcelProperty(value = "安装地点")
    @ColumnWidth(30)
    @ApiModelProperty(value = "安装地点")
    private String installLocation;

    @ExcelProperty(value = "安装方")
    @ColumnWidth(10)
    @NumberFormat
    @ApiModelProperty(value = "安装方")
    @ValueValid(intValues = {1, 2, 3}, message = "安装方非法")
    private Integer installOperator;

    @ExcelProperty(value = "安装系统")
    @ColumnWidth(10)
    @NumberFormat
    @ApiModelProperty(value = "安装系统")
    @ValueValid(intValues = {1, 2}, message = "安装系统非法")
    private Integer installSystem;

    @ExcelProperty(value = "当前状态")
    @ColumnWidth(10)
    @NumberFormat
    @ApiModelProperty(value = "当前状态")
    @ValueValid(intValues = {1, 2, 3}, message = "当前状态非法")
    private Integer nowStatus;

    @ExcelProperty(value = "当前状态时间")
    @ColumnWidth(30)
    @DateTimeFormat("yyyy-MM-dd")
    @ApiModelProperty(value = "当前状态时间")
    @Past(message = "当前状态时间非法")
    private Date nowStatusTime;

}
